package com.ljx.finance.admin.api.controller;


import com.ljx.common.dto.ApiResponse;
import com.ljx.finance.biz.dto.form.GetBase64CodeForm;
import com.ljx.finance.biz.service.MemberLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "用户登录模块")
@RestController
@RequestMapping("/login")
@RequiredArgsConstructor
@Slf4j
public class LoginController {

    final MemberLoginService memberLoginService;

    @ApiOperation(value = "获取客户端id")
    @GetMapping("/getClientId")
    public ApiResponse<String> getClientId(){
        //根据uuid传输游客id
        String result = memberLoginService.getClientId();
        return ApiResponse.success(result);
    }

    @ApiOperation(value = "获取图形验证码")
    @GetMapping("/getBase64Code")
    public ApiResponse<String> getBase64Code(@Validated @ModelAttribute GetBase64CodeForm form){

        String result = memberLoginService.getBase64Code(form);
        return ApiResponse.success(result);
    }


    
}
